import { Map } from "immutable";
import * as actionType from "./constance";

const defaultState = Map({
  singerList: [],
  artistList: [],
  currentArea: 7,
  currentType: {
    name: "华语男歌手",
    url: "1001",
    type: 1,
  },
});

const a = (state = defaultState, action) => {
  switch (action.type) {
    case actionType.GEISINGER:
      return state.set("singerList", action.singers);
    case actionType.GETARTISTLIST:
      return state.set("artistList", action.artistLists);
    case actionType.CHANGE_CURRENT_AREA:
      return state.set("currentArea", action.currentArea);
    case actionType.CHANGE_CURRENT_TYPE:
      return state.set("currentType", action.currentType);
    default:
      return state;
  }
};

export default a;
